package com.example.juc.controller;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author jl
 * @since 2021/9/26 18:48
 */
public class ReEntryLockDemo {
    public static void main(String[] args) {
        ReentrantLock lock = new ReentrantLock();
        lock.lock();
        try {
            System.out.println("===>外层");
            lock.lock();
            try {
                System.out.println("===>内层");
            } finally {
                lock.unlock();
            }
        } finally {
            lock.unlock();
        }
    }
}
